<?=modules::run('home/top');?>

<body>
<?php
	include_once('function/func.php');
?>
<div id="wrapper">
	<header>
		<?=modules::run('home/head');?>
	</header>
	
	<nav id="nav">
		<?=modules::run('home/menu')?>
	</nav>
	
	<div class="barner">
		<div class="barner_left">	
			<a href="#">
				<img src="<?=PATH_URL.'static/'?>images/banner1.jpg" width="700" height="448" />
			</a>
		</div>
		<div class="barner_right">
			<a href="#">
				<img src="<?=PATH_URL.'static/'?>images/banner2.jpg" width="260" height="310" />
			</a>
			<a href="#">
				<img src="<?=PATH_URL.'static/'?>images/banner3.jpg" width="260" height="138" />
			</a>
		</div>
	</div>
	
	<div class="content">
		<h1>Sản phẩm mới</h1>
		<input type="hidden" value="1" id="hiddenCart" />
		<div class="products" id="home">
        	<?php 
				if($products){
					foreach($products as $r){
			?>
			<div class="one_products">
            	<?php if($r->price_new != 0 && $r->promotion != 0):?>
                <div class="sale"></div>
                <?php endif;?>
                <div id="productImageWrapID_<?=$r->id?>">
                    <a title="<?=$r->title?>" href="<?=PATH_URL.'san-pham/chi-tiet/'.$r->id.''?>"><img src="<?=PATH_URL.IMAGES_PRODUCTS.$r->image.''?>" width="150" height="187" /></a>
                </div>
                <p>
                    <a title="<?=$r->title?>" href="<?=PATH_URL.'san-pham/chi-tiet/'.$r->id.''?>"><?=cutString($r->title,45,$type=' ...')?></a>
                </p>
                <?php if($r->price_new != 0 && $r->promotion != 0){?>
                <div class="price_sellers">
                	<strike><?=number_format($r->price_old,0,',','.');?> vnđ</strike>
                    <h4 class="price"><?=number_format($r->price_new,0,',','.');?> vnđ</h4>
                </div>
                <?php }else{?>
                <h4 class="price"><?=number_format($r->price_old,0,',','.');?> vnđ</h4>
                <?php }?>
                <div class="button custom_cart" ><a href="#" id="featuredProduct_<?=$r->id?>" onClick="addCart(<?=$r->id?>); return false">Đặt hàng</a></div>
            </div>
            <?php }}?>
		</div>
	</div><!--end content-->
	
	<footer>
		<?=modules::run('home/footer');?>
	</footer>
</div><!--end wrapper-->
</body>
</html>
